package pe.gob.sunarp.entidad;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the TM_LETRA_RUBRO database table.
 * 
 */
@Embeddable
public class TmLetraRubroPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;
	private String codLibro;
	private String letraRubro;

    public TmLetraRubroPK() {
    }

	@Column(name="COD_LIBRO", unique=true, nullable=false, length=3)
	public String getCodLibro() {
		return this.codLibro;
	}
	public void setCodLibro(String codLibro) {
		this.codLibro = codLibro;
	}

	@Column(name="LETRA_RUBRO", unique=true, nullable=false, length=1)
	public String getLetraRubro() {
		return this.letraRubro;
	}
	public void setLetraRubro(String letraRubro) {
		this.letraRubro = letraRubro;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof TmLetraRubroPK)) {
			return false;
		}
		TmLetraRubroPK castOther = (TmLetraRubroPK)other;
		return 
			this.codLibro.equals(castOther.codLibro)
			&& this.letraRubro.equals(castOther.letraRubro);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.codLibro.hashCode();
		hash = hash * prime + this.letraRubro.hashCode();
		
		return hash;
    }
}